class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.z: A = None
        self.s: I = None
        self.u: G = None
        self.y: A = None
        self.r: D = None
        self.x: G = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: F = None
        self.o: D = None
        self.w: B = None
        self.x: I = None
        self.r: H = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: G = None
        self.s: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.z: A = None
        self.s: I = None
        self.u: G = None
        self.y: A = None
        self.r: D = None
        self.x: G = None
        self.t: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: F = None
        self.o: D = None
        self.w: B = None
        self.x: I = None
        self.r: H = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: G = None
        self.s: H = None
        self.r: B = None
        self.txt = txt

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

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