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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

e.q = b
n.r = l
n.t = l
n.u = h
n.q = i
l.y = n
l.r = e
l.z = b
g.s = n
j.p = g
h.y = b
h.t = j
h.o = i
h.q = g
h.v = n
i.y = e
i.t = j
i.o = h
i.q = g
i.v = n
b.q = e
k.y = n
k.r = e
k.z = b
assert b.q.q.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.r: C = None
        self.u: F = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

e.q = b
n.r = l
n.t = l
n.u = h
n.q = i
l.y = n
l.r = e
l.z = b
g.s = n
j.p = g
h.y = b
h.t = j
h.o = i
h.q = g
h.v = n
i.y = e
i.t = j
i.o = h
i.q = g
i.v = n
b.q = e
k.y = n
k.r = e
k.z = b
assert b.q.q.q.q.q.q.q.q.q.txt == "e"