class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

j.o = m
n.q = i
n.o = i
n.r = g
n.v = l
n.y = l
l.x = j
l.w = g
i.o = g
g.s = j
g.v = i
h.x = j
h.w = g
c.q = i
c.o = i
c.r = g
c.v = l
c.y = l
m.q = i
m.o = i
m.r = g
m.v = h
m.y = h
e.q = i
e.o = i
e.r = g
e.v = l
e.y = h
assert g.s.o.r.s.txt == "j"