class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.w: C = None
        self.q: D = None
        self.z: H = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

c.p = n
c.s = h
c.w = e
c.q = j
c.z = l
c.u = l
b.y = c
b.u = n
b.x = n
b.r = i
b.z = l
b.w = e
e.v = i
e.w = c
e.q = d
e.r = l
e.t = b
e.u = h
j.p = b
j.v = l
j.z = l
j.x = i
j.t = n
i.z = l
i.v = d
n.r = l
n.y = l
n.q = l
n.z = c
n.v = c
n.p = d
n.t = j
n.w = i
h.v = n
l.v = d
m.p = b
m.v = l
m.z = l
m.x = i
m.t = n
d.v = i
d.w = c
d.q = e
d.r = l
d.t = b
d.u = h
assert l.v.u.v.p.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: G = None
        self.w: C = None
        self.q: D = None
        self.z: H = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

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