class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: B = None
        self.o: H = None
        self.s: C = None
        self.w: H = None
        self.y: E = None
        self.x: G = None
        self.q: C = None
        self.p: G = 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.p: F = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: H = None
        self.t: I = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.q: A = None
        self.t: C = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.v: E = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

b.r = c
b.o = c
b.w = c
b.z = d
b.s = f
b.q = f
b.y = i
b.x = m
b.p = m
g.o = i
f.p = e
f.z = g
f.y = b
n.p = e
n.s = e
n.w = c
n.z = c
n.x = f
n.q = f
n.t = f
n.y = g
i.y = n
i.r = c
i.o = c
i.t = h
i.x = f
e.q = i
e.u = i
m.r = g
m.s = i
m.u = i
m.q = b
m.t = f
c.u = m
h.x = b
h.r = m
h.t = m
h.v = i
h.p = d
d.o = i
assert d.o.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: B = None
        self.o: H = None
        self.s: C = None
        self.w: H = None
        self.y: E = None
        self.x: G = None
        self.q: C = None
        self.p: G = 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.p: F = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: H = None
        self.t: I = None
        self.x: C = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.q: A = None
        self.t: C = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.v: E = None
        self.t: G = None
        self.p: B = None
        self.txt = txt

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

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