class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.u: H = None
        self.v: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: A = None
        self.t: I = None
        self.p: I = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: G = None
        self.y: H = None
        self.r: G = None
        self.x: I = None
        self.z: E = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.s: A = None
        self.x: E = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: A = None
        self.t: I = None
        self.p: I = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: G = None
        self.y: H = None
        self.r: G = None
        self.x: I = None
        self.z: E = None
        self.v: H = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.s: A = None
        self.x: E = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

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

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