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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

n = A("n")
c = B("c")
d = C("d")
b = D("b")
m = E("m")
j = F("j")
l = G("l")
i = H("i")
e = H("e")

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

n = A("n")
c = B("c")
d = C("d")
b = D("b")
m = E("m")
j = F("j")
l = G("l")
i = H("i")
e = H("e")

n.p = c
c.u = i
c.x = i
c.o = i
c.p = l
c.w = d
c.v = d
c.r = m
c.y = j
d.o = j
d.t = j
d.y = b
b.y = n
b.u = n
b.p = n
b.w = c
m.s = n
m.v = n
m.q = d
j.x = l
j.v = l
j.u = d
j.p = b
l.t = c
i.q = j
e.q = j
assert n.p.v.o.txt == "j"