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

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

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

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

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

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

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

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

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

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

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

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

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