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

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

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

i = A("i")
e = B("e")
a = C("a")
l = B("l")
j = B("j")
b = B("b")
m = B("m")
f = A("f")
h = C("h")
k = B("k")

i.z = f
i.r = f
i.u = j
e.p = i
e.r = h
a.q = k
a.v = i
l.p = f
l.r = h
j.p = f
j.r = h
b.p = i
b.r = h
m.p = f
m.r = h
f.z = i
f.r = i
f.u = m
h.q = b
h.v = f
k.p = i
k.r = a
assert e.r.q.p.u.p.u.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
a = C("a")
l = B("l")
j = B("j")
b = B("b")
m = B("m")
f = A("f")
h = C("h")
k = B("k")

i.z = f
i.r = f
i.u = j
e.p = i
e.r = h
a.q = k
a.v = i
l.p = f
l.r = h
j.p = f
j.r = h
b.p = i
b.r = h
m.p = f
m.r = h
f.z = i
f.r = i
f.u = m
h.q = b
h.v = f
k.p = i
k.r = a
assert e.r.q.p.u.p.u.r.v.txt == "f"