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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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