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

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

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

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

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

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

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

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

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

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

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

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

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

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

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