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

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

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

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

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

d = A("d")
l = B("l")
g = C("g")
c = D("c")
j = E("j")
k = B("k")

d.w = g
d.y = l
l.y = d
g.r = j
g.u = j
g.y = j
g.v = d
c.w = l
c.x = k
c.p = g
c.t = j
j.y = c
j.v = d
j.p = g
j.q = k
k.y = d
assert l.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
g = C("g")
c = D("c")
j = E("j")
k = B("k")

d.w = g
d.y = l
l.y = d
g.r = j
g.u = j
g.y = j
g.v = d
c.w = l
c.x = k
c.p = g
c.t = j
j.y = c
j.v = d
j.p = g
j.q = k
k.y = d
assert l.y.y.y.y.txt == "l"