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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

d.w = j
d.s = j
d.y = k
h.w = f
h.q = l
h.p = l
l.w = a
l.o = a
k.z = l
k.w = l
a.p = j
i.z = l
i.w = l
f.z = l
f.w = l
j.w = d
j.s = d
j.y = k
assert f.z.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: D = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

d.w = j
d.s = j
d.y = k
h.w = f
h.q = l
h.p = l
l.w = a
l.o = a
k.z = l
k.w = l
a.p = j
i.z = l
i.w = l
f.z = l
f.w = l
j.w = d
j.s = d
j.y = k
assert f.z.o.p.txt == "j"