class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.x: B = None
        self.r: G = None
        self.v: B = None
        self.o: A = None
        self.z: G = None
        self.t: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.s: B = None
        self.z: H = None
        self.w: D = None
        self.x: G = None
        self.u: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: D = None
        self.s: B = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
a = B("a")
k = C("k")
b = D("b")
e = E("e")
j = F("j")
c = G("c")
d = H("d")
f = A("f")

n.q = d
n.p = j
n.x = a
n.v = a
n.r = c
n.z = c
n.t = c
n.o = f
a.v = k
a.o = e
a.u = b
a.t = b
a.y = j
a.q = j
k.t = e
k.r = e
k.w = e
k.o = a
k.y = a
k.q = b
k.s = n
b.t = j
b.q = j
b.p = j
b.z = n
e.z = c
e.o = b
j.q = d
j.z = d
j.r = f
j.s = a
j.w = b
j.y = b
j.x = c
j.u = k
c.z = k
c.y = k
c.q = e
c.x = b
c.u = b
c.s = a
d.s = j
d.r = a
d.u = a
f.q = d
f.p = j
f.x = a
f.v = a
f.r = c
f.z = c
f.t = c
f.o = n
assert k.w.o.z.q.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.x: B = None
        self.r: G = None
        self.v: B = None
        self.o: A = None
        self.z: G = None
        self.t: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: A = None
        self.s: B = None
        self.z: H = None
        self.w: D = None
        self.x: G = None
        self.u: C = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: E = None
        self.x: D = None
        self.s: B = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

n = A("n")
a = B("a")
k = C("k")
b = D("b")
e = E("e")
j = F("j")
c = G("c")
d = H("d")
f = A("f")

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