class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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