class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.o: E = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

i.s = k
i.p = n
i.o = n
i.q = a
i.u = a
d.o = l
d.q = n
l.u = m
l.t = d
m.o = n
m.u = i
n.p = i
a.p = i
a.s = m
a.t = k
k.o = l
k.q = n
assert d.o.u.u.o.p.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: E = None
        self.o: E = None
        self.q: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

i.s = k
i.p = n
i.o = n
i.q = a
i.u = a
d.o = l
d.q = n
l.u = m
l.t = d
m.o = n
m.u = i
n.p = i
a.p = i
a.s = m
a.t = k
k.o = l
k.q = n
assert d.o.u.u.o.p.u.p.txt == "i"