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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: F = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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