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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.r: B = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.s: A = None
        self.q: E = None
        self.y: F = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
j = D("j")
n = E("n")
c = F("c")
g = D("g")
i = A("i")
b = B("b")
a = A("a")

l.q = i
k.y = j
k.x = j
k.z = c
k.r = b
k.u = b
e.q = c
j.x = c
j.y = c
j.t = b
j.s = l
j.q = n
j.w = k
n.s = a
n.q = l
n.v = i
n.r = k
c.z = a
c.p = l
c.w = g
g.x = c
g.y = c
g.t = k
g.s = a
g.q = n
g.w = b
i.q = l
b.y = g
b.z = c
b.r = k
b.u = k
b.x = j
a.q = i
assert c.w.y.p.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: F = None
        self.r: B = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.s: A = None
        self.q: E = None
        self.y: F = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.w: D = None
        self.txt = txt

l = A("l")
k = B("k")
e = C("e")
j = D("j")
n = E("n")
c = F("c")
g = D("g")
i = A("i")
b = B("b")
a = A("a")

l.q = i
k.y = j
k.x = j
k.z = c
k.r = b
k.u = b
e.q = c
j.x = c
j.y = c
j.t = b
j.s = l
j.q = n
j.w = k
n.s = a
n.q = l
n.v = i
n.r = k
c.z = a
c.p = l
c.w = g
g.x = c
g.y = c
g.t = k
g.s = a
g.q = n
g.w = b
i.q = l
b.y = g
b.z = c
b.r = k
b.u = k
b.x = j
a.q = i
assert c.w.y.p.q.q.q.q.txt == "l"