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

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

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

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

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

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

j.o = k
j.r = b
j.z = b
j.p = g
j.q = a
d.o = f
d.s = a
d.z = g
d.v = k
k.v = a
k.x = g
i.x = c
i.r = c
i.o = k
i.s = d
f.r = c
h.x = c
h.o = k
h.r = i
h.s = d
c.x = h
c.o = k
c.r = i
c.s = d
a.r = i
b.o = k
b.r = j
b.z = j
b.p = g
b.q = f
g.o = a
g.s = a
g.z = d
g.v = k
assert g.z.s.r.o.x.z.o.r.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: A = None
        self.z: A = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

j.o = k
j.r = b
j.z = b
j.p = g
j.q = a
d.o = f
d.s = a
d.z = g
d.v = k
k.v = a
k.x = g
i.x = c
i.r = c
i.o = k
i.s = d
f.r = c
h.x = c
h.o = k
h.r = i
h.s = d
c.x = h
c.o = k
c.r = i
c.s = d
a.r = i
b.o = k
b.r = j
b.z = j
b.p = g
b.q = f
g.o = a
g.s = a
g.z = d
g.v = k
assert g.z.s.r.o.x.z.o.r.s.o.txt == "f"