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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: C = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
c = C("c")
d = D("d")
g = E("g")
n = E("n")
i = D("i")
k = C("k")

l.r = d
l.p = d
l.w = g
l.t = g
e.x = k
e.y = c
c.u = n
c.t = k
d.u = n
d.z = e
d.r = g
g.t = e
g.x = l
n.t = e
n.x = l
i.u = g
i.r = g
i.z = e
k.u = n
k.t = c
assert i.u.t.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.p: D = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: C = None
        self.txt = txt

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

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

l = A("l")
e = B("e")
c = C("c")
d = D("d")
g = E("g")
n = E("n")
i = D("i")
k = C("k")

l.r = d
l.p = d
l.w = g
l.t = g
e.x = k
e.y = c
c.u = n
c.t = k
d.u = n
d.z = e
d.r = g
g.t = e
g.x = l
n.t = e
n.x = l
i.u = g
i.r = g
i.z = e
k.u = n
k.t = c
assert i.u.t.y.t.txt == "k"