class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: E = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.y: B = None
        self.t: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: C = None
        self.w: E = None
        self.txt = txt

n = A("n")
m = B("m")
j = C("j")
d = D("d")
h = E("h")
b = F("b")
c = F("c")

n.t = j
n.q = m
m.p = n
m.r = h
j.s = d
d.t = b
d.z = h
d.w = j
d.o = j
h.z = d
h.p = d
h.x = d
h.s = d
h.y = m
h.t = b
b.y = h
b.w = h
b.u = j
c.y = h
c.w = h
c.u = j
assert c.w.t.u.s.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: E = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.x: D = None
        self.y: B = None
        self.t: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: C = None
        self.w: E = None
        self.txt = txt

n = A("n")
m = B("m")
j = C("j")
d = D("d")
h = E("h")
b = F("b")
c = F("c")

n.t = j
n.q = m
m.p = n
m.r = h
j.s = d
d.t = b
d.z = h
d.w = j
d.o = j
h.z = d
h.p = d
h.x = d
h.s = d
h.y = m
h.t = b
b.y = h
b.w = h
b.u = j
c.y = h
c.w = h
c.u = j
assert c.w.t.u.s.t.y.txt == "h"