class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.t: F = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: C = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.y: A = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: B = None
        self.s: F = None
        self.q: B = None
        self.o: E = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
b = C("b")
e = D("e")
h = E("h")
f = F("f")
l = F("l")
a = C("a")

k.r = b
k.w = b
k.u = b
k.q = l
k.t = f
j.r = f
j.x = b
j.v = h
j.s = h
b.o = h
b.r = k
b.y = k
b.u = e
b.z = a
e.w = h
e.o = h
e.v = j
e.u = j
e.q = j
e.s = f
h.u = e
f.q = h
f.z = h
l.q = h
l.z = h
a.o = h
a.r = k
a.y = k
a.u = e
a.z = b
assert a.z.r.q.q.u.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.t: F = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: C = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: A = None
        self.y: A = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: B = None
        self.u: B = None
        self.s: F = None
        self.q: B = None
        self.o: E = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
b = C("b")
e = D("e")
h = E("h")
f = F("f")
l = F("l")
a = C("a")

k.r = b
k.w = b
k.u = b
k.q = l
k.t = f
j.r = f
j.x = b
j.v = h
j.s = h
b.o = h
b.r = k
b.y = k
b.u = e
b.z = a
e.w = h
e.o = h
e.v = j
e.u = j
e.q = j
e.s = f
h.u = e
f.q = h
f.z = h
l.q = h
l.z = h
a.o = h
a.r = k
a.y = k
a.u = e
a.z = b
assert a.z.r.q.q.u.s.z.txt == "h"