class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

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

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

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

l.u = m
l.p = i
l.s = i
l.q = n
k.x = l
k.s = f
k.t = f
n.u = j
i.z = j
i.v = f
i.x = l
i.p = e
m.v = j
m.z = l
m.u = l
m.p = k
m.o = e
m.r = e
j.s = n
f.x = l
f.s = k
f.t = k
e.v = j
e.z = l
e.u = l
e.p = f
e.o = m
e.r = m
assert k.s.x.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: B = None
        self.x: A = None
        self.p: E = None
        self.txt = txt

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

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

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

l.u = m
l.p = i
l.s = i
l.q = n
k.x = l
k.s = f
k.t = f
n.u = j
i.z = j
i.v = f
i.x = l
i.p = e
m.v = j
m.z = l
m.u = l
m.p = k
m.o = e
m.r = e
j.s = n
f.x = l
f.s = k
f.t = k
e.v = j
e.z = l
e.u = l
e.p = f
e.o = m
e.r = m
assert k.s.x.u.p.txt == "k"