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

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.y: E = None
        self.u: C = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.w: D = None
        self.z: B = None
        self.q: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
h = B("h")
d = C("d")
b = D("b")
f = E("f")
a = F("a")
j = E("j")
l = B("l")
m = B("m")

n.p = d
n.x = d
n.w = d
n.q = h
h.w = n
d.p = b
d.v = b
b.o = h
b.t = n
b.y = j
b.u = d
b.p = d
b.v = f
f.u = n
f.p = b
f.w = b
f.q = b
f.z = h
f.v = a
a.u = n
a.t = n
j.u = n
j.p = b
j.w = b
j.q = b
j.z = m
j.v = a
l.w = n
m.w = n
assert n.p.v.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: A = None
        self.y: E = None
        self.u: C = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.w: D = None
        self.z: B = None
        self.q: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
h = B("h")
d = C("d")
b = D("b")
f = E("f")
a = F("a")
j = E("j")
l = B("l")
m = B("m")

n.p = d
n.x = d
n.w = d
n.q = h
h.w = n
d.p = b
d.v = b
b.o = h
b.t = n
b.y = j
b.u = d
b.p = d
b.v = f
f.u = n
f.p = b
f.w = b
f.q = b
f.z = h
f.v = a
a.u = n
a.t = n
j.u = n
j.p = b
j.w = b
j.q = b
j.z = m
j.v = a
l.w = n
m.w = n
assert n.p.v.v.u.x.txt == "d"