class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: E = None
        self.u: G = None
        self.w: C = None
        self.y: G = None
        self.p: E = None
        self.s: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.r: C = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.r: C = None
        self.x: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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