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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.v: D = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

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

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

l.t = g
l.r = g
l.v = e
l.w = k
l.x = c
n.x = g
k.x = e
k.u = e
k.v = e
k.s = c
k.o = l
e.r = g
e.y = l
g.v = l
g.r = l
c.x = e
c.u = e
c.v = e
c.s = k
c.o = l
assert k.v.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: D = None
        self.w: C = None
        self.x: C = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.v: D = None
        self.s: C = None
        self.o: A = None
        self.txt = txt

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

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

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

l.t = g
l.r = g
l.v = e
l.w = k
l.x = c
n.x = g
k.x = e
k.u = e
k.v = e
k.s = c
k.o = l
e.r = g
e.y = l
g.v = l
g.r = l
c.x = e
c.u = e
c.v = e
c.s = k
c.o = l
assert k.v.y.w.txt == "k"