class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
n = C("n")
c = D("c")
a = E("a")
j = F("j")
l = C("l")
b = E("b")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
n = C("n")
c = D("c")
a = E("a")
j = F("j")
l = C("l")
b = E("b")

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