class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: B = None
        self.x: C = None
        self.u: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

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

a = A("a")
l = B("l")
d = C("d")
k = D("k")
i = E("i")
b = F("b")
h = G("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: E = None
        self.q: F = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.p: G = None
        self.txt = txt

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

a = A("a")
l = B("l")
d = C("d")
k = D("k")
i = E("i")
b = F("b")
h = G("h")

a.t = i
a.y = l
a.x = d
a.u = h
l.t = k
d.w = l
k.z = a
k.y = i
k.q = b
k.s = b
i.z = h
i.x = h
i.u = b
i.o = b
i.y = a
b.v = l
b.x = l
b.p = h
h.w = l
h.o = a
assert l.t.y.o.p.txt == "h"