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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

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

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

l.y = j
l.x = j
l.w = g
l.r = i
l.u = a
k.r = a
k.z = j
j.x = a
j.v = a
j.r = i
j.z = l
i.r = g
g.x = k
g.y = j
a.y = j
a.x = j
a.w = g
a.r = i
a.u = l
assert g.x.r.y.r.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: E = None
        self.r: D = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: D = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

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

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

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

l.y = j
l.x = j
l.w = g
l.r = i
l.u = a
k.r = a
k.z = j
j.x = a
j.v = a
j.r = i
j.z = l
i.r = g
g.x = k
g.y = j
a.y = j
a.x = j
a.w = g
a.r = i
a.u = l
assert g.x.r.y.r.r.x.txt == "k"