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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.u: B = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

j.p = h
j.t = h
j.u = i
j.v = f
j.s = l
i.v = h
i.q = g
i.p = g
h.q = f
h.r = m
h.u = m
h.v = c
h.t = g
h.x = i
f.p = l
f.v = h
f.s = j
c.s = m
c.q = m
c.p = f
c.y = l
c.v = h
m.t = f
m.o = i
m.u = g
m.v = h
m.r = j
g.v = h
g.q = i
g.p = i
l.s = m
l.q = m
l.p = f
l.y = c
l.v = h
assert i.q.q.v.v.s.r.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: B = None
        self.t: C = None
        self.v: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: B = None
        self.u: B = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

j.p = h
j.t = h
j.u = i
j.v = f
j.s = l
i.v = h
i.q = g
i.p = g
h.q = f
h.r = m
h.u = m
h.v = c
h.t = g
h.x = i
f.p = l
f.v = h
f.s = j
c.s = m
c.q = m
c.p = f
c.y = l
c.v = h
m.t = f
m.o = i
m.u = g
m.v = h
m.r = j
g.v = h
g.q = i
g.p = i
l.s = m
l.q = m
l.p = f
l.y = c
l.v = h
assert i.q.q.v.v.s.r.s.s.txt == "m"