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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: G = None
        self.u: A = None
        self.o: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.p: F = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: B = None
        self.q: B = None
        self.p: H = None
        self.v: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.txt = txt

c = A("c")
m = B("m")
a = C("a")
k = D("k")
l = E("l")
f = F("f")
d = G("d")
n = H("n")
i = F("i")

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: G = None
        self.u: A = None
        self.o: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: A = None
        self.p: F = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: B = None
        self.q: B = None
        self.p: H = None
        self.v: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.txt = txt

c = A("c")
m = B("m")
a = C("a")
k = D("k")
l = E("l")
f = F("f")
d = G("d")
n = H("n")
i = F("i")

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