class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.v: C = None
        self.x: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.r: F = None
        self.t: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: E = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: D = None
        self.r: F = None
        self.t: D = None
        self.txt = txt

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

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

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