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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.p: E = None
        self.u: E = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
d = C("d")
k = D("k")
g = E("g")
i = F("i")
c = D("c")
m = E("m")

n.u = c
n.p = k
n.z = i
n.w = m
n.o = l
l.s = k
l.z = i
d.x = n
d.z = k
d.p = g
d.u = m
d.y = i
d.o = i
k.t = n
k.x = c
k.q = l
g.y = k
g.u = l
g.v = i
g.w = n
g.z = d
i.o = n
c.t = n
c.x = k
c.q = l
m.y = k
m.u = l
m.v = i
m.w = n
m.z = d
assert n.w.v.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.z: F = None
        self.w: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.p: E = None
        self.u: E = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
d = C("d")
k = D("k")
g = E("g")
i = F("i")
c = D("c")
m = E("m")

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