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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.w: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.v: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.y: G = None
        self.s: C = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: E = None
        self.w: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.v: B = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: F = None
        self.y: G = None
        self.s: C = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.y: C = None
        self.q: F = None
        self.txt = txt

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

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