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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.q: E = None
        self.w: C = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.s: A = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

n = A("n")
b = B("b")
d = C("d")
a = D("a")
f = E("f")
e = F("e")
i = A("i")

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.q: E = None
        self.w: C = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.s: A = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

n = A("n")
b = B("b")
d = C("d")
a = D("a")
f = E("f")
e = F("e")
i = A("i")

n.t = e
n.o = e
n.w = f
n.z = d
n.p = b
n.r = a
b.s = f
b.q = f
b.z = d
b.w = d
b.u = d
b.t = d
d.v = i
d.u = b
a.x = f
a.v = f
a.r = n
a.z = n
a.s = i
f.s = e
f.u = d
e.q = a
e.u = d
i.t = e
i.o = e
i.w = f
i.z = d
i.p = b
i.r = a
assert n.z.v.o.txt == "e"