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

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

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

l = A("l")
h = B("h")
k = C("k")
c = A("c")
j = A("j")
a = C("a")
n = A("n")
f = B("f")

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

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

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

l = A("l")
h = B("h")
k = C("k")
c = A("c")
j = A("j")
a = C("a")
n = A("n")
f = B("f")

l.y = k
l.q = k
l.x = h
h.t = a
h.q = n
h.u = f
k.s = f
k.z = a
k.w = j
c.y = k
c.x = h
c.q = a
j.y = k
j.q = k
j.x = f
a.s = f
a.z = k
a.w = n
n.y = k
n.q = k
n.x = f
f.t = a
f.q = c
f.u = h
assert n.q.w.y.s.t.txt == "a"