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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

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

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

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

a = A("a")
n = B("n")
f = C("f")
m = D("m")
e = E("e")
g = B("g")
c = A("c")
k = D("k")

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.z: C = None
        self.txt = txt

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

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

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

a = A("a")
n = B("n")
f = C("f")
m = D("m")
e = E("e")
g = B("g")
c = A("c")
k = D("k")

a.o = f
a.x = g
a.q = n
a.w = k
a.r = e
n.p = e
n.t = e
n.z = f
f.s = e
f.v = e
f.x = k
f.p = a
f.r = m
m.o = f
m.t = c
e.z = c
e.v = c
e.x = f
g.p = e
g.t = e
g.z = f
c.o = f
c.x = n
c.q = g
c.w = m
c.r = e
k.o = f
k.t = a
assert a.x.t.z.w.t.q.t.x.txt == "f"