class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: C = None
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

b.p = g
b.t = f
b.v = h
b.s = h
b.o = n
n.s = h
n.q = h
h.x = e
h.y = m
h.v = n
h.u = g
h.p = b
j.s = b
j.y = h
j.q = n
j.o = e
g.x = b
g.r = h
m.s = l
m.y = h
m.q = f
m.o = j
c.s = h
c.q = h
l.p = g
l.t = n
l.o = n
l.v = h
l.s = h
f.s = h
f.q = h
e.s = b
e.y = h
e.q = c
e.o = j
assert l.v.p.v.v.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: C = None
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: C = None
        self.txt = txt

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

b.p = g
b.t = f
b.v = h
b.s = h
b.o = n
n.s = h
n.q = h
h.x = e
h.y = m
h.v = n
h.u = g
h.p = b
j.s = b
j.y = h
j.q = n
j.o = e
g.x = b
g.r = h
m.s = l
m.y = h
m.q = f
m.o = j
c.s = h
c.q = h
l.p = g
l.t = n
l.o = n
l.v = h
l.s = h
f.s = h
f.q = h
e.s = b
e.y = h
e.q = c
e.o = j
assert l.v.p.v.v.q.p.txt == "b"