class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: A = None
        self.u: B = None
        self.x: G = None
        self.s: A = None
        self.p: H = None
        self.v: A = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: H = None
        self.y: H = None
        self.r: B = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.q: B = None
        self.v: G = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: H = None
        self.y: H = None
        self.r: B = None
        self.q: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: D = None
        self.q: B = None
        self.v: G = None
        self.s: A = None
        self.o: D = None
        self.txt = txt

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

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