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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: G = None
        self.r: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: B = None
        self.p: E = None
        self.t: B = None
        self.w: B = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.u: E = None
        self.p: C = None
        self.w: B = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: G = None
        self.r: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.y: D = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: B = None
        self.p: E = None
        self.t: B = None
        self.w: B = None
        self.o: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.u: E = None
        self.p: C = None
        self.w: B = None
        self.v: C = None
        self.q: B = None
        self.txt = txt

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

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