class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

l = A("l")
a = B("a")
k = C("k")
f = D("f")
j = E("j")
i = A("i")
e = C("e")
d = C("d")

l.w = f
l.s = j
l.x = i
a.s = l
k.o = a
k.v = l
k.y = j
k.r = i
f.s = i
f.t = d
f.x = l
f.u = a
j.o = i
j.t = d
i.w = f
i.s = j
i.x = l
e.o = a
e.v = i
e.r = i
e.y = j
d.o = a
d.v = i
d.y = j
d.r = l
assert d.r.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.x: A = None
        self.txt = txt

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

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

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

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

l = A("l")
a = B("a")
k = C("k")
f = D("f")
j = E("j")
i = A("i")
e = C("e")
d = C("d")

l.w = f
l.s = j
l.x = i
a.s = l
k.o = a
k.v = l
k.y = j
k.r = i
f.s = i
f.t = d
f.x = l
f.u = a
j.o = i
j.t = d
i.w = f
i.s = j
i.x = l
e.o = a
e.v = i
e.r = i
e.y = j
d.o = a
d.v = i
d.y = j
d.r = l
assert d.r.x.w.txt == "f"