class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: H = None
        self.y: F = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: A = None
        self.p: D = None
        self.o: H = None
        self.z: I = None
        self.v: I = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.t: H = None
        self.q: I = None
        self.p: C = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.q: D = None
        self.y: A = None
        self.o: E = None
        self.p: D = None
        self.s: D = None
        self.r: E = None
        self.txt = txt

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

g.x = n
g.q = h
g.y = d
g.z = j
b.r = h
b.o = h
b.x = g
b.p = n
b.z = k
b.v = k
b.t = f
c.v = h
c.p = d
n.x = b
n.v = k
f.r = c
f.p = c
f.v = c
f.o = n
f.t = h
f.q = k
f.u = m
d.s = n
d.x = n
d.z = m
d.q = f
d.v = c
d.o = g
d.y = g
d.r = k
d.p = j
m.t = d
m.v = h
h.q = g
h.t = d
k.t = j
k.v = j
k.q = n
k.p = n
k.s = n
k.y = g
k.o = f
k.r = f
j.r = h
j.o = h
j.x = g
j.p = n
j.z = k
j.v = k
j.t = f
assert k.p.x.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: H = None
        self.y: F = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: A = None
        self.p: D = None
        self.o: H = None
        self.z: I = None
        self.v: I = None
        self.t: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.t: H = None
        self.q: I = None
        self.p: C = None
        self.u: G = None
        self.v: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.q: D = None
        self.y: A = None
        self.o: E = None
        self.p: D = None
        self.s: D = None
        self.r: E = None
        self.txt = txt

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

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