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

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

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

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

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

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

j.o = d
j.p = d
j.z = d
j.r = i
c.t = j
c.u = g
i.w = d
h.o = m
h.w = c
l.s = i
d.t = g
d.u = g
g.o = d
g.p = d
g.z = d
g.r = m
n.s = i
m.w = d
f.o = i
f.w = c
assert h.w.u.r.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: B = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

j.o = d
j.p = d
j.z = d
j.r = i
c.t = j
c.u = g
i.w = d
h.o = m
h.w = c
l.s = i
d.t = g
d.u = g
g.o = d
g.p = d
g.z = d
g.r = m
n.s = i
m.w = d
f.o = i
f.w = c
assert h.w.u.r.w.t.txt == "g"