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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.r: B = None
        self.u: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: B = None
        self.p: H = None
        self.x: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

i.z = h
i.u = n
i.p = a
i.q = f
a.p = g
l.o = a
g.t = l
g.p = k
g.r = a
g.u = h
g.s = h
h.s = i
h.v = i
h.q = a
h.p = n
h.x = n
k.y = l
f.o = h
f.z = n
f.r = i
f.x = k
n.q = a
assert k.y.o.p.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: H = None
        self.p: B = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: F = None
        self.r: B = None
        self.u: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: B = None
        self.p: H = None
        self.x: H = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

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

i.z = h
i.u = n
i.p = a
i.q = f
a.p = g
l.o = a
g.t = l
g.p = k
g.r = a
g.u = h
g.s = h
h.s = i
h.v = i
h.q = a
h.p = n
h.x = n
k.y = l
f.o = h
f.z = n
f.r = i
f.x = k
n.q = a
assert k.y.o.p.t.o.txt == "a"