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

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

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

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

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

l = A("l")
h = B("h")
i = C("i")
n = D("n")
g = E("g")
m = A("m")
j = B("j")

l.v = j
l.t = j
l.x = g
l.u = h
l.s = n
h.u = j
h.s = g
i.s = g
i.q = g
n.w = l
n.s = g
g.t = m
g.w = m
g.y = l
g.r = h
m.v = h
m.t = h
m.x = g
m.u = j
m.s = n
j.u = h
j.s = g
assert i.q.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.x: E = None
        self.u: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

l = A("l")
h = B("h")
i = C("i")
n = D("n")
g = E("g")
m = A("m")
j = B("j")

l.v = j
l.t = j
l.x = g
l.u = h
l.s = n
h.u = j
h.s = g
i.s = g
i.q = g
n.w = l
n.s = g
g.t = m
g.w = m
g.y = l
g.r = h
m.v = h
m.t = h
m.x = g
m.u = j
m.s = n
j.u = h
j.s = g
assert i.q.w.v.txt == "h"