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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: C = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

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

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

f.x = h
f.w = c
e.t = a
e.q = a
d.z = e
d.x = m
d.r = m
d.v = g
a.w = h
a.z = h
a.v = c
a.p = c
j.x = a
j.o = f
m.z = h
m.x = g
m.v = g
m.r = d
h.t = a
h.q = a
g.z = h
g.x = m
g.r = m
g.v = d
c.x = a
c.o = f
assert d.v.r.z.t.p.o.w.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: C = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

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

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

f.x = h
f.w = c
e.t = a
e.q = a
d.z = e
d.x = m
d.r = m
d.v = g
a.w = h
a.z = h
a.v = c
a.p = c
j.x = a
j.o = f
m.z = h
m.x = g
m.v = g
m.r = d
h.t = a
h.q = a
g.z = h
g.x = m
g.r = m
g.v = d
c.x = a
c.o = f
assert d.v.r.z.t.p.o.w.x.p.txt == "c"