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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.x: B = None
        self.p: H = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.x: B = None
        self.p: H = None
        self.q: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: C = None
        self.x: F = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: D = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

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

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