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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.q: C = None
        self.r: G = None
        self.w: C = None
        self.y: A = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.q: C = None
        self.r: G = None
        self.w: C = None
        self.y: A = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: E = None
        self.txt = txt

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

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