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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: E = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: E = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: H = None
        self.y: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: G = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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