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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

l.v = i
l.o = c
l.q = k
l.x = f
c.r = k
f.p = c
f.w = b
f.z = b
f.r = b
g.t = b
g.w = l
g.q = f
i.p = h
i.u = g
i.r = c
i.x = f
h.p = i
h.u = g
h.r = c
h.x = b
k.v = h
k.o = c
k.q = l
k.x = f
b.p = c
b.w = f
b.z = f
b.r = f
assert l.v.p.r.r.v.x.w.txt == "f"