class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: I = None
        self.s: F = None
        self.x: F = None
        self.p: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: C = None
        self.z: C = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.y: B = None
        self.s: E = None
        self.w: F = None
        self.t: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.r: F = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.r: F = None
        self.w: F = None
        self.p: I = None
        self.z: F = None
        self.t: H = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: C = None
        self.z: C = None
        self.v: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.y: B = None
        self.s: E = None
        self.w: F = None
        self.t: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.r: F = None
        self.z: E = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.r: F = None
        self.w: F = None
        self.p: I = None
        self.z: F = None
        self.t: H = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: C = None
        self.p: C = None
        self.r: A = None
        self.txt = txt

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

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