class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: B = None
        self.z: F = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.u: D = None
        self.r: E = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.p: A = None
        self.w: E = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.u: D = None
        self.r: E = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.p: A = None
        self.w: E = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

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

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

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