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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.x: E = None
        self.s: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

e = A("e")
j = B("j")
n = C("n")
a = D("a")
b = E("b")
c = F("c")
k = C("k")
i = F("i")

e.p = a
e.o = n
e.w = k
j.w = c
j.s = c
j.t = e
j.z = e
j.x = b
j.p = k
n.o = j
n.q = e
n.u = e
n.x = e
n.w = a
a.o = j
a.p = e
a.x = n
b.o = n
b.q = a
c.p = b
c.u = j
c.o = a
c.w = i
c.t = i
k.o = j
k.q = e
k.u = e
k.x = e
k.w = a
i.p = b
i.u = j
i.o = a
i.w = c
i.t = c
assert k.o.x.q.x.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.x: E = None
        self.s: F = None
        self.p: C = None
        self.txt = txt

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

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

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

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

e = A("e")
j = B("j")
n = C("n")
a = D("a")
b = E("b")
c = F("c")
k = C("k")
i = F("i")

e.p = a
e.o = n
e.w = k
j.w = c
j.s = c
j.t = e
j.z = e
j.x = b
j.p = k
n.o = j
n.q = e
n.u = e
n.x = e
n.w = a
a.o = j
a.p = e
a.x = n
b.o = n
b.q = a
c.p = b
c.u = j
c.o = a
c.w = i
c.t = i
k.o = j
k.q = e
k.u = e
k.x = e
k.w = a
i.p = b
i.u = j
i.o = a
i.w = c
i.t = c
assert k.o.x.q.x.w.o.txt == "j"