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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

k = A("k")
e = B("e")
i = C("i")
d = D("d")
h = E("h")
c = F("c")
n = A("n")
f = A("f")
m = F("m")
l = E("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: A = None
        self.x: D = None
        self.w: B = None
        self.txt = txt

k = A("k")
e = B("e")
i = C("i")
d = D("d")
h = E("h")
c = F("c")
n = A("n")
f = A("f")
m = F("m")
l = E("l")

k.q = h
k.u = d
k.s = l
e.q = f
e.o = i
i.o = h
i.s = h
i.z = e
i.y = d
d.p = h
d.y = f
d.z = e
d.x = c
h.z = i
h.y = d
h.r = c
h.q = e
h.t = e
c.o = d
c.x = d
c.v = k
c.w = e
n.q = h
n.u = d
n.s = l
f.q = h
f.u = d
f.s = l
m.o = d
m.x = d
m.v = k
m.w = e
l.z = i
l.y = d
l.r = m
l.q = e
l.t = e
assert l.y.x.v.txt == "k"