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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.o: F = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.o: F = None
        self.v: F = None
        self.p: B = None
        self.txt = txt

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

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

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