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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

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

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

m.q = k
i.y = k
i.x = l
i.o = l
g.w = m
g.v = l
g.y = l
k.p = g
k.r = g
k.q = h
l.y = m
h.w = m
h.v = l
h.y = l
j.w = m
j.v = l
j.y = l
c.w = m
c.v = l
c.y = l
assert m.q.q.y.y.q.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.r: C = None
        self.txt = txt

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

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

m.q = k
i.y = k
i.x = l
i.o = l
g.w = m
g.v = l
g.y = l
k.p = g
k.r = g
k.q = h
l.y = m
h.w = m
h.v = l
h.y = l
j.w = m
j.v = l
j.y = l
c.w = m
c.v = l
c.y = l
assert m.q.q.y.y.q.q.v.txt == "l"