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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.p: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: C = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.z: C = None
        self.r: F = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

d = A("d")
c = B("c")
i = C("i")
h = D("h")
b = E("b")
m = F("m")
g = G("g")
f = A("f")
l = G("l")
a = F("a")

d.t = c
d.y = h
c.r = d
c.p = b
c.u = a
c.t = i
i.o = h
i.t = g
i.p = c
h.y = a
h.z = d
h.p = l
h.r = c
b.r = h
b.y = i
b.w = c
b.p = d
m.v = b
m.y = b
m.s = a
m.r = a
m.z = i
m.t = f
g.q = c
g.s = d
g.x = l
f.t = c
f.y = h
l.q = c
l.s = d
l.x = g
a.v = b
a.y = b
a.s = m
a.r = m
a.z = i
a.t = d
assert m.z.t.q.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.p: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: C = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: F = None
        self.z: C = None
        self.r: F = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

d = A("d")
c = B("c")
i = C("i")
h = D("h")
b = E("b")
m = F("m")
g = G("g")
f = A("f")
l = G("l")
a = F("a")

d.t = c
d.y = h
c.r = d
c.p = b
c.u = a
c.t = i
i.o = h
i.t = g
i.p = c
h.y = a
h.z = d
h.p = l
h.r = c
b.r = h
b.y = i
b.w = c
b.p = d
m.v = b
m.y = b
m.s = a
m.r = a
m.z = i
m.t = f
g.q = c
g.s = d
g.x = l
f.t = c
f.y = h
l.q = c
l.s = d
l.x = g
a.v = b
a.y = b
a.s = m
a.r = m
a.z = i
a.t = d
assert m.z.t.q.t.o.txt == "h"