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

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

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

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

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

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

m.q = f
m.y = f
m.u = b
m.p = n
m.w = j
b.w = f
b.v = c
e.q = j
e.x = i
n.u = c
c.v = n
c.q = n
c.y = j
j.w = c
j.v = c
f.v = n
f.q = n
f.y = j
i.q = j
i.x = e
assert c.y.w.q.u.q.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: B = None
        self.p: D = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

m.q = f
m.y = f
m.u = b
m.p = n
m.w = j
b.w = f
b.v = c
e.q = j
e.x = i
n.u = c
c.v = n
c.q = n
c.y = j
j.w = c
j.v = c
f.v = n
f.q = n
f.y = j
i.q = j
i.x = e
assert c.y.w.q.u.q.u.q.txt == "n"