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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.q: B = None
        self.w: D = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: B = None
        self.q: B = None
        self.w: D = None
        self.z: C = None
        self.s: B = None
        self.txt = txt

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

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