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

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

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

k = A("k")
a = B("a")
j = C("j")
b = C("b")
m = B("m")
f = B("f")
c = C("c")
h = C("h")

k.t = h
a.o = b
a.u = b
a.y = k
j.v = k
j.u = a
j.x = h
b.v = k
b.u = m
b.x = h
m.o = h
m.u = c
m.y = k
f.o = j
f.u = j
f.y = k
c.v = k
c.u = m
c.x = j
h.v = k
h.u = a
h.x = b
assert f.o.v.t.x.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
j = C("j")
b = C("b")
m = B("m")
f = B("f")
c = C("c")
h = C("h")

k.t = h
a.o = b
a.u = b
a.y = k
j.v = k
j.u = a
j.x = h
b.v = k
b.u = m
b.x = h
m.o = h
m.u = c
m.y = k
f.o = j
f.u = j
f.y = k
c.v = k
c.u = m
c.x = j
h.v = k
h.u = a
h.x = b
assert f.o.v.t.x.u.u.u.txt == "m"