class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.x: C = None
        self.txt = txt

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

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

n.o = a
n.v = a
n.z = c
n.t = j
e.r = j
e.s = n
e.q = c
h.z = a
h.o = a
h.t = n
h.u = l
h.r = e
h.p = c
j.w = f
j.v = f
j.x = h
j.u = n
j.z = a
j.p = e
c.w = a
c.q = l
c.x = l
a.p = n
l.z = a
l.o = a
l.t = n
l.u = h
l.r = b
l.p = c
f.w = j
f.v = j
f.x = h
f.u = n
f.z = a
f.p = e
b.r = j
b.s = n
b.q = c
assert n.t.p.r.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.v: F = None
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.x: C = None
        self.txt = txt

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

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

n.o = a
n.v = a
n.z = c
n.t = j
e.r = j
e.s = n
e.q = c
h.z = a
h.o = a
h.t = n
h.u = l
h.r = e
h.p = c
j.w = f
j.v = f
j.x = h
j.u = n
j.z = a
j.p = e
c.w = a
c.q = l
c.x = l
a.p = n
l.z = a
l.o = a
l.t = n
l.u = h
l.r = b
l.p = c
f.w = j
f.v = j
f.x = h
f.u = n
f.z = a
f.p = e
b.r = j
b.s = n
b.q = c
assert n.t.p.r.w.z.txt == "a"