class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.y: I = None
        self.r: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.x: F = None
        self.q: I = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: I = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.s: D = None
        self.y: I = None
        self.r: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: C = None
        self.x: F = None
        self.q: I = None
        self.z: B = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.u: I = None
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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