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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: H = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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