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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: B = None
        self.v: D = None
        self.q: D = None
        self.o: D = None
        self.txt = txt

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

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

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

f.p = d
f.w = b
b.p = f
b.q = k
k.z = j
k.u = g
k.v = d
k.o = d
k.q = l
c.w = f
c.o = f
c.s = h
c.v = h
j.y = d
j.x = b
j.s = g
j.q = k
g.p = h
g.q = k
h.p = l
h.w = g
l.w = h
l.s = h
l.o = f
l.v = f
d.w = h
d.o = h
d.v = h
d.s = f
e.y = c
e.x = b
e.s = b
e.q = k
assert l.s.p.v.w.q.q.o.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: B = None
        self.v: D = None
        self.q: D = None
        self.o: D = None
        self.txt = txt

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

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

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

f.p = d
f.w = b
b.p = f
b.q = k
k.z = j
k.u = g
k.v = d
k.o = d
k.q = l
c.w = f
c.o = f
c.s = h
c.v = h
j.y = d
j.x = b
j.s = g
j.q = k
g.p = h
g.q = k
h.p = l
h.w = g
l.w = h
l.s = h
l.o = f
l.v = f
d.w = h
d.o = h
d.v = h
d.s = f
e.y = c
e.x = b
e.s = b
e.q = k
assert l.s.p.v.w.q.q.o.p.o.p.txt == "l"