class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: C = None
        self.q: A = None
        self.s: E = None
        self.u: D = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.q: H = None
        self.s: D = None
        self.p: C = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: H = None
        self.q: B = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: H = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.r: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: A = None
        self.q: H = None
        self.s: D = None
        self.p: C = None
        self.o: C = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: H = None
        self.q: B = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: H = None
        self.v: F = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.r: F = None
        self.txt = txt

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

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