class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: C = None
        self.u: B = None
        self.v: I = None
        self.w: H = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.w: F = None
        self.v: D = None
        self.x: D = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: H = None
        self.z: D = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.v: A = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.w: F = None
        self.v: D = None
        self.x: D = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: H = None
        self.z: D = None
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.v: A = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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