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

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

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

i = A("i")
g = B("g")
k = C("k")
j = A("j")
c = C("c")
h = C("h")
n = A("n")
l = A("l")
m = B("m")
a = C("a")

i.y = h
i.z = l
i.q = j
g.w = m
g.q = h
k.u = g
k.x = l
j.y = k
j.z = n
j.q = n
c.u = g
c.x = j
h.u = m
h.x = n
n.y = a
n.z = j
n.q = l
l.y = a
l.z = i
l.q = n
m.w = g
m.q = h
a.u = m
a.x = n
assert i.y.u.q.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: A = None
        self.q: A = None
        self.txt = txt

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

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

i = A("i")
g = B("g")
k = C("k")
j = A("j")
c = C("c")
h = C("h")
n = A("n")
l = A("l")
m = B("m")
a = C("a")

i.y = h
i.z = l
i.q = j
g.w = m
g.q = h
k.u = g
k.x = l
j.y = k
j.z = n
j.q = n
c.u = g
c.x = j
h.u = m
h.x = n
n.y = a
n.z = j
n.q = l
l.y = a
l.z = i
l.q = n
m.w = g
m.q = h
a.u = m
a.x = n
assert i.y.u.q.x.q.txt == "l"