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

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

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

i = A("i")
e = B("e")
g = C("g")
m = A("m")
c = B("c")
l = B("l")
n = B("n")
j = C("j")
f = A("f")
h = B("h")

i.y = j
e.t = m
e.u = h
g.q = j
g.v = j
g.y = e
m.y = j
c.t = i
c.u = l
l.t = m
l.u = n
n.t = i
n.u = h
j.q = g
j.v = g
j.y = e
f.y = j
h.t = f
h.u = e
assert n.t.y.q.y.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
g = C("g")
m = A("m")
c = B("c")
l = B("l")
n = B("n")
j = C("j")
f = A("f")
h = B("h")

i.y = j
e.t = m
e.u = h
g.q = j
g.v = j
g.y = e
m.y = j
c.t = i
c.u = l
l.t = m
l.u = n
n.t = i
n.u = h
j.q = g
j.v = g
j.y = e
f.y = j
h.t = f
h.u = e
assert n.t.y.q.y.u.u.u.txt == "h"