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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.s: C = None
        self.u: C = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.w: G = None
        self.v: G = None
        self.o: F = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.s: C = None
        self.u: C = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.w: G = None
        self.v: G = None
        self.o: F = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.txt = txt

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

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