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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

l = A("l")
c = B("c")
a = C("a")
d = D("d")
n = E("n")
m = F("m")
e = G("e")
k = D("k")

l.v = m
l.x = m
l.y = n
l.u = n
l.r = a
c.p = l
a.v = m
a.p = c
a.u = d
d.u = a
d.r = a
d.v = n
n.w = c
m.v = k
e.y = m
e.o = m
e.q = l
e.s = n
k.u = a
k.r = a
k.v = n
assert m.v.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: E = None
        self.u: E = None
        self.r: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: A = None
        self.s: E = None
        self.o: F = None
        self.txt = txt

l = A("l")
c = B("c")
a = C("a")
d = D("d")
n = E("n")
m = F("m")
e = G("e")
k = D("k")

l.v = m
l.x = m
l.y = n
l.u = n
l.r = a
c.p = l
a.v = m
a.p = c
a.u = d
d.u = a
d.r = a
d.v = n
n.w = c
m.v = k
e.y = m
e.o = m
e.q = l
e.s = n
k.u = a
k.r = a
k.v = n
assert m.v.u.p.txt == "c"