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

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

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

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

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

l = A("l")
a = B("a")
c = C("c")
h = D("h")
d = E("d")
f = A("f")
i = C("i")
j = E("j")
g = E("g")

l.o = f
l.w = f
a.v = g
c.p = i
c.r = d
c.o = h
h.o = c
h.p = c
d.w = a
d.o = h
d.u = h
d.y = g
f.o = l
f.w = l
i.p = c
i.r = d
i.o = h
j.w = a
j.o = h
j.u = h
j.y = g
g.w = a
g.o = h
g.u = h
g.y = d
assert h.p.r.w.v.o.p.o.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

l = A("l")
a = B("a")
c = C("c")
h = D("h")
d = E("d")
f = A("f")
i = C("i")
j = E("j")
g = E("g")

l.o = f
l.w = f
a.v = g
c.p = i
c.r = d
c.o = h
h.o = c
h.p = c
d.w = a
d.o = h
d.u = h
d.y = g
f.o = l
f.w = l
i.p = c
i.r = d
i.o = h
j.w = a
j.o = h
j.u = h
j.y = g
g.w = a
g.o = h
g.u = h
g.y = d
assert h.p.r.w.v.o.p.o.o.p.txt == "i"