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

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

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

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

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

g = A("g")
h = B("h")
c = C("c")
b = D("b")
i = E("i")
f = B("f")
k = E("k")
e = A("e")
j = C("j")
n = E("n")

g.w = i
h.q = e
h.y = c
c.w = n
b.y = g
b.q = e
b.r = n
b.z = k
b.s = f
i.y = b
i.v = b
f.q = g
f.y = j
k.y = b
k.v = b
e.w = i
j.w = n
n.y = b
n.v = b
assert j.w.y.r.y.z.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

g = A("g")
h = B("h")
c = C("c")
b = D("b")
i = E("i")
f = B("f")
k = E("k")
e = A("e")
j = C("j")
n = E("n")

g.w = i
h.q = e
h.y = c
c.w = n
b.y = g
b.q = e
b.r = n
b.z = k
b.s = f
i.y = b
i.v = b
f.q = g
f.y = j
k.y = b
k.v = b
e.w = i
j.w = n
n.y = b
n.v = b
assert j.w.y.r.y.z.y.q.txt == "e"