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

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

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

i = A("i")
l = B("l")
h = C("h")
e = C("e")
a = B("a")
j = B("j")
g = C("g")
k = A("k")

i.y = l
i.w = a
i.z = j
l.u = g
l.q = g
l.p = i
h.y = a
h.z = k
h.t = l
e.y = l
e.t = l
e.z = k
a.u = g
a.p = k
a.q = e
j.u = e
j.p = k
j.q = h
g.y = l
g.t = l
g.z = i
k.y = l
k.w = a
k.z = a
assert l.q.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.z: B = None
        self.txt = txt

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

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

i = A("i")
l = B("l")
h = C("h")
e = C("e")
a = B("a")
j = B("j")
g = C("g")
k = A("k")

i.y = l
i.w = a
i.z = j
l.u = g
l.q = g
l.p = i
h.y = a
h.z = k
h.t = l
e.y = l
e.t = l
e.z = k
a.u = g
a.p = k
a.q = e
j.u = e
j.p = k
j.q = h
g.y = l
g.t = l
g.z = i
k.y = l
k.w = a
k.z = a
assert l.q.t.u.txt == "g"