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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.v: D = None
        self.o: F = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.t: F = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

j = A("j")
l = B("l")
m = C("m")
a = D("a")
n = E("n")
k = F("k")
d = F("d")
c = E("c")
e = A("e")

j.q = e
l.u = k
l.v = m
m.u = d
m.w = e
m.v = a
m.o = k
m.x = j
m.t = j
a.v = l
n.z = m
n.q = k
n.y = e
n.s = c
k.u = c
k.w = c
k.o = n
k.y = n
k.t = d
d.u = n
d.o = c
d.y = c
d.w = c
d.t = k
c.z = m
c.q = d
c.y = e
c.s = n
e.q = j
assert j.q.q.q.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.u: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.v: D = None
        self.o: F = None
        self.x: A = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: E = None
        self.t: F = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

j = A("j")
l = B("l")
m = C("m")
a = D("a")
n = E("n")
k = F("k")
d = F("d")
c = E("c")
e = A("e")

j.q = e
l.u = k
l.v = m
m.u = d
m.w = e
m.v = a
m.o = k
m.x = j
m.t = j
a.v = l
n.z = m
n.q = k
n.y = e
n.s = c
k.u = c
k.w = c
k.o = n
k.y = n
k.t = d
d.u = n
d.o = c
d.y = c
d.w = c
d.t = k
c.z = m
c.q = d
c.y = e
c.s = n
e.q = j
assert j.q.q.q.q.q.q.q.txt == "e"