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

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

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

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

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

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

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

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

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

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

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

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

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

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

c.y = m
c.v = m
c.r = h
c.x = a
e.v = h
e.y = l
n.r = e
n.s = f
n.q = b
n.v = j
n.u = j
n.x = j
f.s = m
f.q = m
f.v = e
h.q = l
h.s = e
l.u = h
l.p = a
j.s = n
j.q = m
j.v = e
m.r = b
m.q = b
m.s = f
m.x = f
m.v = j
m.u = j
a.y = n
a.v = m
a.r = h
a.x = c
b.v = h
b.y = l
assert m.x.q.s.s.r.y.p.r.q.txt == "l"