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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.u: A = None
        self.o: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.s: B = None
        self.r: D = None
        self.q: F = None
        self.o: H = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: A = None
        self.s: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.txt = txt

d = A("d")
m = B("m")
n = C("n")
a = D("a")
j = E("j")
k = F("k")
h = G("h")
c = H("c")
l = F("l")

d.x = m
d.y = l
m.r = h
m.u = n
m.x = k
n.p = a
n.r = l
n.o = d
a.z = c
a.p = j
a.y = j
j.q = c
j.v = c
j.u = d
j.o = k
j.z = k
k.p = a
k.r = a
k.x = h
k.s = m
k.q = l
k.o = c
k.u = j
k.w = j
h.x = a
h.z = d
h.q = d
h.s = m
c.z = n
c.r = m
l.p = a
l.r = a
l.x = h
l.s = m
l.q = k
l.o = c
l.u = j
l.w = j
assert h.s.r.x.p.q.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: H = None
        self.u: A = None
        self.o: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.s: B = None
        self.r: D = None
        self.q: F = None
        self.o: H = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: A = None
        self.s: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: B = None
        self.txt = txt

d = A("d")
m = B("m")
n = C("n")
a = D("a")
j = E("j")
k = F("k")
h = G("h")
c = H("c")
l = F("l")

d.x = m
d.y = l
m.r = h
m.u = n
m.x = k
n.p = a
n.r = l
n.o = d
a.z = c
a.p = j
a.y = j
j.q = c
j.v = c
j.u = d
j.o = k
j.z = k
k.p = a
k.r = a
k.x = h
k.s = m
k.q = l
k.o = c
k.u = j
k.w = j
h.x = a
h.z = d
h.q = d
h.s = m
c.z = n
c.r = m
l.p = a
l.r = a
l.x = h
l.s = m
l.q = k
l.o = c
l.u = j
l.w = j
assert h.s.r.x.p.q.z.p.txt == "a"