class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: C = None
        self.v: I = None
        self.o: D = None
        self.x: D = None
        self.u: F = None
        self.w: G = None
        self.p: F = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: A = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.o: B = None
        self.z: H = None
        self.s: A = None
        self.v: F = None
        self.r: I = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.r: B = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.w: C = None
        self.u: D = None
        self.p: H = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: A = None
        self.p: F = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.o: B = None
        self.z: H = None
        self.s: A = None
        self.v: F = None
        self.r: I = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.r: B = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.w: C = None
        self.u: D = None
        self.p: H = None
        self.q: D = None
        self.txt = txt

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

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