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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

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

f.v = a
f.s = a
f.t = g
f.q = b
b.s = c
b.o = a
d.u = k
d.r = f
d.q = a
d.t = c
a.x = c
k.v = b
k.o = c
k.p = a
k.z = a
e.u = k
e.t = k
e.r = g
e.q = a
c.v = b
c.o = k
c.p = a
c.z = a
g.v = a
g.s = a
g.t = f
g.q = b
assert f.q.o.x.o.p.x.o.v.txt == "b"