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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: I = None
        self.x: I = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.r: D = None
        self.x: H = None
        self.y: G = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.y: I = None
        self.p: C = None
        self.u: D = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: I = None
        self.x: I = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.r: D = None
        self.x: H = None
        self.y: G = None
        self.p: C = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.y: I = None
        self.p: C = None
        self.u: D = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: H = None
        self.x: B = None
        self.txt = txt

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

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