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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.u: G = None
        self.q: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: E = None
        self.u: G = None
        self.q: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: B = None
        self.txt = txt

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

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

k.o = j
k.z = h
b.p = i
b.x = l
b.u = j
b.q = n
b.y = g
i.u = h
i.s = n
n.u = g
n.z = i
l.q = b
l.z = k
l.y = h
g.q = k
j.y = h
j.w = b
h.t = l
h.o = b
assert n.u.q.o.y.t.z.z.txt == "h"