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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: A = None
        self.y: E = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

n.q = m
n.v = e
n.p = i
g.p = l
b.p = j
b.r = j
b.v = a
b.s = a
m.v = f
m.p = j
m.y = n
m.r = a
e.v = a
e.q = n
e.y = l
e.u = l
e.o = b
a.x = f
a.w = n
a.s = g
i.q = f
i.v = e
i.p = n
f.v = m
f.p = j
f.y = n
f.r = a
l.v = a
l.q = n
l.y = e
l.u = e
l.o = b
j.p = b
j.r = b
j.v = a
j.s = a
assert n.p.q.v.r.s.p.q.q.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: A = None
        self.y: E = None
        self.u: E = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

n.q = m
n.v = e
n.p = i
g.p = l
b.p = j
b.r = j
b.v = a
b.s = a
m.v = f
m.p = j
m.y = n
m.r = a
e.v = a
e.q = n
e.y = l
e.u = l
e.o = b
a.x = f
a.w = n
a.s = g
i.q = f
i.v = e
i.p = n
f.v = m
f.p = j
f.y = n
f.r = a
l.v = a
l.q = n
l.y = e
l.u = e
l.o = b
j.p = b
j.r = b
j.v = a
j.s = a
assert n.p.q.v.r.s.p.q.q.r.txt == "a"