class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: G = None
        self.u: F = None
        self.y: E = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.v: G = None
        self.u: F = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.txt = txt

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

j.v = c
j.p = n
b.z = h
b.o = a
b.u = n
b.y = d
b.t = j
c.z = h
c.q = e
e.z = k
e.y = j
e.v = a
e.u = n
e.t = b
d.u = m
n.p = h
n.t = b
a.o = n
h.t = m
h.v = j
k.u = d
m.u = d
assert j.p.p.v.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: G = None
        self.u: F = None
        self.y: E = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.v: G = None
        self.u: F = None
        self.t: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.txt = txt

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

j.v = c
j.p = n
b.z = h
b.o = a
b.u = n
b.y = d
b.t = j
c.z = h
c.q = e
e.z = k
e.y = j
e.v = a
e.u = n
e.t = b
d.u = m
n.p = h
n.t = b
a.o = n
h.t = m
h.v = j
k.u = d
m.u = d
assert j.p.p.v.p.p.txt == "h"