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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.p: D = None
        self.z: C = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: C = None
        self.p: D = None
        self.z: C = None
        self.t: D = None
        self.txt = txt

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

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

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