class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: I = None
        self.x: D = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.w: F = None
        self.r: H = None
        self.q: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: H = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.w: B = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: B = None
        self.w: E = None
        self.s: C = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.txt = txt

j = A("j")
k = B("k")
a = C("a")
c = D("c")
l = E("l")
h = F("h")
g = G("g")
e = H("e")
m = I("m")

j.q = k
j.v = k
j.p = m
j.x = c
j.r = l
k.s = l
k.z = l
k.w = h
k.r = e
k.q = m
a.o = e
a.r = e
a.z = g
a.w = c
c.s = a
c.p = a
c.v = h
c.u = e
l.w = g
l.x = h
h.y = j
h.x = m
h.p = e
g.s = j
g.y = k
g.w = k
g.t = k
g.o = c
e.v = j
e.t = k
e.w = l
e.p = l
e.q = l
e.s = a
m.y = c
m.u = j
assert g.y.q.u.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: I = None
        self.x: D = None
        self.r: E = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: E = None
        self.w: F = None
        self.r: H = None
        self.q: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: H = None
        self.z: G = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.w: B = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: B = None
        self.w: E = None
        self.s: C = None
        self.p: E = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: A = None
        self.txt = txt

j = A("j")
k = B("k")
a = C("a")
c = D("c")
l = E("l")
h = F("h")
g = G("g")
e = H("e")
m = I("m")

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