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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.v: D = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.x: D = None
        self.t: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: F = None
        self.v: D = None
        self.u: C = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: A = None
        self.x: D = None
        self.t: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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