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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: G = None
        self.v: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: G = None
        self.v: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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