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

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

i = A("i")
c = B("c")
f = B("f")
e = A("e")
m = B("m")
n = A("n")
b = B("b")
j = B("j")

i.z = m
c.t = m
c.u = f
f.t = j
f.u = c
e.z = f
m.t = c
m.u = c
n.z = f
b.t = m
b.u = c
j.t = c
j.u = m
assert i.z.u.t.t.t.u.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

i = A("i")
c = B("c")
f = B("f")
e = A("e")
m = B("m")
n = A("n")
b = B("b")
j = B("j")

i.z = m
c.t = m
c.u = f
f.t = j
f.u = c
e.z = f
m.t = c
m.u = c
n.z = f
b.t = m
b.u = c
j.t = c
j.u = m
assert i.z.u.t.t.t.u.t.t.txt == "c"