class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.v: B = None
        self.p: F = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.s: D = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

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

h.q = e
c.t = j
c.u = b
f.q = h
f.y = h
f.z = h
f.v = c
f.r = c
f.p = b
e.u = j
j.o = h
j.t = h
j.v = c
j.s = c
b.u = j
b.p = j
b.o = h
b.s = e
b.r = c
a.o = h
a.t = h
a.v = c
a.s = c
assert a.t.q.u.s.u.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.v: B = None
        self.p: F = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: B = None
        self.t: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: A = None
        self.s: D = None
        self.r: B = None
        self.p: E = None
        self.txt = txt

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

h.q = e
c.t = j
c.u = b
f.q = h
f.y = h
f.z = h
f.v = c
f.r = c
f.p = b
e.u = j
j.o = h
j.t = h
j.v = c
j.s = c
b.u = j
b.p = j
b.o = h
b.s = e
b.r = c
a.o = h
a.t = h
a.v = c
a.s = c
assert a.t.q.u.s.u.r.t.txt == "j"