class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.v: F = None
        self.s: D = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: G = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: G = None
        self.v: E = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: A = None
        self.s: F = None
        self.r: F = None
        self.txt = txt

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

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