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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.r: G = None
        self.o: G = None
        self.v: G = None
        self.y: D = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.r: E = None
        self.w: C = None
        self.o: F = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

m = A("m")
c = B("c")
j = C("j")
k = D("k")
f = E("f")
d = F("d")
e = G("e")
h = F("h")
g = E("g")

m.w = d
c.y = j
c.t = k
c.u = e
c.w = e
j.r = g
j.q = k
j.x = f
j.s = c
j.t = h
k.o = d
k.p = m
k.q = c
f.u = c
f.x = k
f.y = k
f.r = e
f.o = e
f.v = e
f.s = e
d.w = f
d.q = f
d.z = h
d.t = h
d.v = j
d.x = m
e.u = k
e.q = j
e.w = j
e.r = g
e.o = h
e.s = m
e.z = c
h.w = f
h.q = f
h.z = d
h.t = d
h.v = j
h.x = m
g.u = c
g.x = k
g.y = k
g.r = e
g.o = e
g.v = e
g.s = e
assert j.t.q.o.o.x.w.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.u: G = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.r: G = None
        self.o: G = None
        self.v: G = None
        self.y: D = None
        self.s: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: C = None
        self.r: E = None
        self.w: C = None
        self.o: F = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

m = A("m")
c = B("c")
j = C("j")
k = D("k")
f = E("f")
d = F("d")
e = G("e")
h = F("h")
g = E("g")

m.w = d
c.y = j
c.t = k
c.u = e
c.w = e
j.r = g
j.q = k
j.x = f
j.s = c
j.t = h
k.o = d
k.p = m
k.q = c
f.u = c
f.x = k
f.y = k
f.r = e
f.o = e
f.v = e
f.s = e
d.w = f
d.q = f
d.z = h
d.t = h
d.v = j
d.x = m
e.u = k
e.q = j
e.w = j
e.r = g
e.o = h
e.s = m
e.z = c
h.w = f
h.q = f
h.z = d
h.t = d
h.v = j
h.x = m
g.u = c
g.x = k
g.y = k
g.r = e
g.o = e
g.v = e
g.s = e
assert j.t.q.o.o.x.w.z.z.txt == "d"