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

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

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

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

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

a = A("a")
i = B("i")
l = C("l")
k = D("k")
g = E("g")
f = B("f")
m = D("m")
b = A("b")

a.q = i
a.w = i
i.v = g
i.w = f
l.p = g
l.y = g
l.w = i
l.q = i
k.u = b
g.s = b
f.v = g
f.w = i
m.u = b
b.q = f
b.w = i
assert i.w.w.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

a = A("a")
i = B("i")
l = C("l")
k = D("k")
g = E("g")
f = B("f")
m = D("m")
b = A("b")

a.q = i
a.w = i
i.v = g
i.w = f
l.p = g
l.y = g
l.w = i
l.q = i
k.u = b
g.s = b
f.v = g
f.w = i
m.u = b
b.q = f
b.w = i
assert i.w.w.v.s.txt == "b"