class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.t: I = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: I = None
        self.z: C = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: H = None
        self.t: I = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: I = None
        self.z: C = None
        self.u: C = None
        self.x: E = None
        self.txt = txt

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

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

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