class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

f.y = i
k.o = i
k.y = i
k.x = i
k.s = i
i.w = a
a.o = i
a.q = i
l.s = f
l.w = a
l.r = a
j.o = i
j.y = i
j.x = i
j.s = i
assert i.w.q.w.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.x: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

f.y = i
k.o = i
k.y = i
k.x = i
k.s = i
i.w = a
a.o = i
a.q = i
l.s = f
l.w = a
l.r = a
j.o = i
j.y = i
j.x = i
j.s = i
assert i.w.q.w.q.w.q.txt == "i"