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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.s: H = None
        self.t: D = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: G = None
        self.s: H = None
        self.t: D = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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