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

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

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

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

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

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

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

e.t = n
i.w = k
i.s = k
i.x = k
k.o = n
k.p = m
n.y = k
n.w = m
j.u = i
j.y = e
m.p = k
m.o = i
m.w = i
m.r = i
m.u = e
m.y = n
assert m.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

e.t = n
i.w = k
i.s = k
i.x = k
k.o = n
k.p = m
n.y = k
n.w = m
j.u = i
j.y = e
m.p = k
m.o = i
m.w = i
m.r = i
m.u = e
m.y = n
assert m.u.t.y.txt == "k"