class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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