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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
n = C("n")
c = D("c")
l = E("l")
e = D("e")

b.x = c
b.w = i
i.y = c
n.w = e
n.v = l
n.u = l
n.y = i
c.s = i
c.w = i
l.q = n
l.v = n
l.p = b
l.s = b
e.s = i
e.w = i
assert e.w.y.w.y.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.u: E = None
        self.y: B = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
n = C("n")
c = D("c")
l = E("l")
e = D("e")

b.x = c
b.w = i
i.y = c
n.w = e
n.v = l
n.u = l
n.y = i
c.s = i
c.w = i
l.q = n
l.v = n
l.p = b
l.s = b
e.s = i
e.w = i
assert e.w.y.w.y.w.y.txt == "c"