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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

l = A("l")
f = B("f")
k = C("k")
c = D("c")
a = E("a")
j = A("j")
h = C("h")

l.w = f
l.s = f
l.y = a
l.v = j
f.t = a
f.p = a
f.r = j
k.s = c
k.o = c
k.t = f
k.p = a
c.z = f
a.z = f
a.r = k
a.p = l
a.w = j
j.w = f
j.s = f
j.y = a
j.v = l
h.s = c
h.o = c
h.t = f
h.p = a
assert k.t.r.v.y.p.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: B = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: B = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.p: A = None
        self.w: A = None
        self.txt = txt

l = A("l")
f = B("f")
k = C("k")
c = D("c")
a = E("a")
j = A("j")
h = C("h")

l.w = f
l.s = f
l.y = a
l.v = j
f.t = a
f.p = a
f.r = j
k.s = c
k.o = c
k.t = f
k.p = a
c.z = f
a.z = f
a.r = k
a.p = l
a.w = j
j.w = f
j.s = f
j.y = a
j.v = l
h.s = c
h.o = c
h.t = f
h.p = a
assert k.t.r.v.y.p.w.r.txt == "j"