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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: F = None
        self.txt = txt

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

e.t = b
e.q = b
e.x = m
e.p = c
e.s = c
e.r = g
e.y = j
j.s = e
k.q = m
k.v = b
k.o = b
c.z = b
c.x = a
c.p = j
c.s = m
m.q = k
b.z = g
b.y = m
b.q = e
b.t = a
a.s = j
a.r = b
n.q = m
n.v = b
n.o = b
g.q = m
g.v = b
g.o = b
assert k.q.q.q.q.q.q.o.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.x: E = None
        self.p: D = None
        self.s: D = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: F = None
        self.txt = txt

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

e.t = b
e.q = b
e.x = m
e.p = c
e.s = c
e.r = g
e.y = j
j.s = e
k.q = m
k.v = b
k.o = b
c.z = b
c.x = a
c.p = j
c.s = m
m.q = k
b.z = g
b.y = m
b.q = e
b.t = a
a.s = j
a.r = b
n.q = m
n.v = b
n.o = b
g.q = m
g.v = b
g.o = b
assert k.q.q.q.q.q.q.o.y.q.txt == "k"