class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: F = None
        self.u: G = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.v: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.p: C = None
        self.v: D = None
        self.u: D = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
f = D("f")
j = E("j")
n = F("n")
e = G("e")
i = F("i")
k = E("k")

l.u = k
b.r = n
b.v = i
b.w = l
d.v = l
d.o = n
d.p = n
d.u = e
d.z = k
f.x = i
f.s = l
f.v = j
f.t = d
f.q = d
j.q = b
j.t = b
j.w = d
j.p = d
j.v = f
j.u = f
j.r = e
n.o = l
n.w = k
n.q = i
e.z = f
e.x = i
e.p = l
e.u = n
i.o = l
i.w = k
i.q = n
k.q = b
k.t = b
k.w = d
k.p = d
k.v = f
k.u = f
k.r = e
assert k.t.r.o.u.p.z.q.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: F = None
        self.u: G = None
        self.p: F = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.v: E = None
        self.t: C = None
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.p: C = None
        self.v: D = None
        self.u: D = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.q: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

l = A("l")
b = B("b")
d = C("d")
f = D("f")
j = E("j")
n = F("n")
e = G("e")
i = F("i")
k = E("k")

l.u = k
b.r = n
b.v = i
b.w = l
d.v = l
d.o = n
d.p = n
d.u = e
d.z = k
f.x = i
f.s = l
f.v = j
f.t = d
f.q = d
j.q = b
j.t = b
j.w = d
j.p = d
j.v = f
j.u = f
j.r = e
n.o = l
n.w = k
n.q = i
e.z = f
e.x = i
e.p = l
e.u = n
i.o = l
i.w = k
i.q = n
k.q = b
k.t = b
k.w = d
k.p = d
k.v = f
k.u = f
k.r = e
assert k.t.r.o.u.p.z.q.w.u.txt == "k"