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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
i = C("i")
m = D("m")
d = E("d")
b = F("b")
k = F("k")

l.p = e
l.o = e
l.y = e
l.s = i
l.q = k
e.y = d
e.r = d
i.v = e
m.u = e
m.r = e
m.q = d
m.t = d
d.p = l
d.v = l
d.s = e
d.u = i
d.w = k
b.x = k
k.x = b
assert e.y.w.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.o: B = None
        self.q: F = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

l = A("l")
e = B("e")
i = C("i")
m = D("m")
d = E("d")
b = F("b")
k = F("k")

l.p = e
l.o = e
l.y = e
l.s = i
l.q = k
e.y = d
e.r = d
i.v = e
m.u = e
m.r = e
m.q = d
m.t = d
d.p = l
d.v = l
d.s = e
d.u = i
d.w = k
b.x = k
k.x = b
assert e.y.w.x.x.txt == "k"