class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: B = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.y: B = None
        self.q: D = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.y: B = None
        self.q: D = None
        self.v: H = None
        self.t: B = None
        self.txt = txt

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

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

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