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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.z: D = None
        self.v: H = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.s: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: B = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

i = A("i")
m = B("m")
g = C("g")
f = D("f")
e = E("e")
c = F("c")
a = G("a")
j = H("j")
d = D("d")
h = B("h")

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.z: D = None
        self.v: H = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.s: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: B = None
        self.q: A = None
        self.y: F = None
        self.txt = txt

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

i = A("i")
m = B("m")
g = C("g")
f = D("f")
e = E("e")
c = F("c")
a = G("a")
j = H("j")
d = D("d")
h = B("h")

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