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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

j.q = b
j.p = l
i.y = n
i.q = a
i.u = k
i.v = m
c.y = k
c.v = l
c.r = n
k.o = c
b.r = l
n.r = i
n.p = i
n.t = d
n.s = d
n.u = c
l.p = c
m.y = n
m.q = a
m.u = k
m.v = i
a.r = l
d.r = l
assert a.r.p.v.p.y.o.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

j.q = b
j.p = l
i.y = n
i.q = a
i.u = k
i.v = m
c.y = k
c.v = l
c.r = n
k.o = c
b.r = l
n.r = i
n.p = i
n.t = d
n.s = d
n.u = c
l.p = c
m.y = n
m.q = a
m.u = k
m.v = i
a.r = l
d.r = l
assert a.r.p.v.p.y.o.v.p.txt == "c"