class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.p: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

j.z = m
i.v = g
i.q = g
i.w = l
i.p = b
n.y = l
n.t = f
n.r = d
n.w = m
m.v = l
m.t = b
m.y = g
l.p = j
d.x = b
d.p = b
d.r = g
d.s = l
d.t = m
b.v = j
b.x = l
b.z = n
b.s = g
g.x = b
g.p = b
g.r = d
g.s = l
g.t = m
f.y = l
f.t = n
f.r = g
f.w = m
e.v = g
e.w = l
e.p = b
e.q = d
assert e.w.p.z.v.p.z.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.p: G = None
        self.q: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: C = None
        self.r: F = None
        self.w: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: E = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

j.z = m
i.v = g
i.q = g
i.w = l
i.p = b
n.y = l
n.t = f
n.r = d
n.w = m
m.v = l
m.t = b
m.y = g
l.p = j
d.x = b
d.p = b
d.r = g
d.s = l
d.t = m
b.v = j
b.x = l
b.z = n
b.s = g
g.x = b
g.p = b
g.r = d
g.s = l
g.t = m
f.y = l
f.t = n
f.r = g
f.w = m
e.v = g
e.w = l
e.p = b
e.q = d
assert e.w.p.z.v.p.z.t.s.txt == "g"