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

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

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

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

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

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

l.v = c
c.t = e
c.w = e
c.q = h
c.s = d
c.y = g
h.v = d
d.s = e
d.w = e
d.y = h
e.o = d
e.y = l
n.t = e
n.w = e
n.q = h
n.s = d
n.y = g
i.t = e
i.w = e
i.q = h
i.s = d
i.y = g
g.t = e
g.w = e
g.q = h
g.s = d
g.y = c
assert d.w.y.v.s.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

l.v = c
c.t = e
c.w = e
c.q = h
c.s = d
c.y = g
h.v = d
d.s = e
d.w = e
d.y = h
e.o = d
e.y = l
n.t = e
n.w = e
n.q = h
n.s = d
n.y = g
i.t = e
i.w = e
i.q = h
i.s = d
i.y = g
g.t = e
g.w = e
g.q = h
g.s = d
g.y = c
assert d.w.y.v.s.y.v.txt == "d"