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

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

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

f = A("f")
b = B("b")
e = C("e")
n = B("n")
i = A("i")
k = C("k")
j = B("j")
h = C("h")

f.u = i
f.w = i
b.v = i
b.z = i
b.r = f
e.o = j
e.q = f
e.s = i
n.v = f
n.z = f
n.r = i
i.u = f
i.w = f
k.o = j
k.q = i
k.s = i
j.v = i
j.r = i
j.z = i
h.o = j
h.q = f
h.s = f
assert b.z.u.u.u.u.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: A = None
        self.txt = txt

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

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

f = A("f")
b = B("b")
e = C("e")
n = B("n")
i = A("i")
k = C("k")
j = B("j")
h = C("h")

f.u = i
f.w = i
b.v = i
b.z = i
b.r = f
e.o = j
e.q = f
e.s = i
n.v = f
n.z = f
n.r = i
i.u = f
i.w = f
k.o = j
k.q = i
k.s = i
j.v = i
j.r = i
j.z = i
h.o = j
h.q = f
h.s = f
assert b.z.u.u.u.u.u.w.txt == "i"