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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
b = C("b")
k = D("k")
e = E("e")
c = A("c")
m = C("m")
f = C("f")

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
b = C("b")
k = D("k")
e = E("e")
c = A("c")
m = C("m")
f = C("f")

g.v = e
g.x = b
l.o = b
l.r = e
l.p = k
b.v = k
k.z = g
k.y = g
k.p = g
e.q = m
e.s = l
e.p = k
e.o = g
e.w = b
c.v = e
c.x = b
m.v = k
f.v = k
assert l.o.v.z.txt == "g"