class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: A = None
        self.t: I = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: I = None
        self.u: D = None
        self.x: H = None
        self.p: F = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: I = None
        self.w: A = None
        self.t: H = None
        self.u: A = None
        self.o: H = None
        self.p: D = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: A = None
        self.t: I = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: G = None
        self.t: G = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: I = None
        self.u: D = None
        self.x: H = None
        self.p: F = None
        self.y: F = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.z: I = None
        self.w: A = None
        self.t: H = None
        self.u: A = None
        self.o: H = None
        self.p: D = None
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: E = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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