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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.t: E = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
e = C("e")
m = D("m")
l = E("l")
f = F("f")
d = D("d")
g = C("g")
c = A("c")

j.v = c
j.u = n
j.s = n
j.p = l
n.u = c
n.p = j
e.r = n
e.p = j
e.t = l
e.x = f
e.s = f
m.u = j
m.r = d
m.w = e
m.x = l
l.v = j
f.s = g
f.v = l
f.u = n
d.u = j
d.r = m
d.w = g
d.x = l
g.r = n
g.p = j
g.t = l
g.x = f
g.s = f
c.v = j
c.u = n
c.s = n
c.p = l
assert c.v.p.v.p.v.s.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.s: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.t: E = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
e = C("e")
m = D("m")
l = E("l")
f = F("f")
d = D("d")
g = C("g")
c = A("c")

j.v = c
j.u = n
j.s = n
j.p = l
n.u = c
n.p = j
e.r = n
e.p = j
e.t = l
e.x = f
e.s = f
m.u = j
m.r = d
m.w = e
m.x = l
l.v = j
f.s = g
f.v = l
f.u = n
d.u = j
d.r = m
d.w = g
d.x = l
g.r = n
g.p = j
g.t = l
g.x = f
g.s = f
c.v = j
c.u = n
c.s = n
c.p = l
assert c.v.p.v.p.v.s.p.u.txt == "n"