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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.t: C = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

h = A("h")
a = B("a")
e = C("e")
n = D("n")
k = E("k")
c = F("c")
d = G("d")
g = C("g")
i = A("i")

h.o = a
h.t = a
h.u = k
h.y = k
a.u = g
a.v = g
a.x = n
a.w = c
a.q = e
a.y = d
e.z = d
n.o = k
n.q = k
n.r = c
k.y = a
k.o = a
k.t = e
k.q = c
c.p = n
d.y = e
d.z = k
d.w = k
d.u = k
g.z = d
i.o = a
i.t = a
i.u = k
i.y = k
assert h.y.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: B = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.t: C = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

h = A("h")
a = B("a")
e = C("e")
n = D("n")
k = E("k")
c = F("c")
d = G("d")
g = C("g")
i = A("i")

h.o = a
h.t = a
h.u = k
h.y = k
a.u = g
a.v = g
a.x = n
a.w = c
a.q = e
a.y = d
e.z = d
n.o = k
n.q = k
n.r = c
k.y = a
k.o = a
k.t = e
k.q = c
c.p = n
d.y = e
d.z = k
d.w = k
d.u = k
g.z = d
i.o = a
i.t = a
i.u = k
i.y = k
assert h.y.t.z.txt == "d"