class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: F = None
        self.s: C = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
b = C("b")
a = D("a")
k = E("k")
l = F("l")

i.y = k
i.o = k
n.p = b
n.w = k
b.o = n
b.x = i
b.p = i
b.y = l
a.p = l
a.x = l
a.s = b
k.y = n
k.q = n
k.s = i
k.x = i
k.r = i
l.t = a
assert n.p.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: F = None
        self.s: C = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
b = C("b")
a = D("a")
k = E("k")
l = F("l")

i.y = k
i.o = k
n.p = b
n.w = k
b.o = n
b.x = i
b.p = i
b.y = l
a.p = l
a.x = l
a.s = b
k.y = n
k.q = n
k.s = i
k.x = i
k.r = i
l.t = a
assert n.p.x.o.txt == "k"