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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.w: A = None
        self.o: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: F = None
        self.r: A = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: D = None
        self.w: A = None
        self.o: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: F = None
        self.r: A = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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