class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.o: I = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: D = None
        self.x: I = None
        self.y: I = None
        self.r: C = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.s: E = None
        self.u: E = None
        self.x: B = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: F = None
        self.z: D = None
        self.x: I = None
        self.y: I = None
        self.r: C = None
        self.o: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: A = None
        self.s: E = None
        self.u: E = None
        self.x: B = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

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

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