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

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

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

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

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

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

m = A("m")
n = B("n")
i = C("i")
f = D("f")
k = E("k")
g = F("g")
j = F("j")
d = D("d")
c = A("c")
a = C("a")

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

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

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

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

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

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

m = A("m")
n = B("n")
i = C("i")
f = D("f")
k = E("k")
g = F("g")
j = F("j")
d = D("d")
c = A("c")
a = C("a")

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