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

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

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

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

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

j = A("j")
l = B("l")
d = C("d")
c = D("c")
e = E("e")
b = C("b")
k = B("k")
i = D("i")

j.w = k
l.r = e
l.s = k
d.v = j
d.x = e
d.y = b
c.x = j
c.y = j
e.s = i
e.t = i
e.v = d
e.w = c
b.v = j
b.x = e
b.y = d
k.r = e
k.s = l
i.x = j
i.y = j
assert l.r.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
d = C("d")
c = D("c")
e = E("e")
b = C("b")
k = B("k")
i = D("i")

j.w = k
l.r = e
l.s = k
d.v = j
d.x = e
d.y = b
c.x = j
c.y = j
e.s = i
e.t = i
e.v = d
e.w = c
b.v = j
b.x = e
b.y = d
k.r = e
k.s = l
i.x = j
i.y = j
assert l.r.s.x.txt == "j"