class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.w: C = None
        self.o: A = None
        self.r: I = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: I = None
        self.r: B = None
        self.z: C = None
        self.x: I = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.q: A = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: C = None
        self.w: C = None
        self.o: A = None
        self.r: I = None
        self.s: H = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: I = None
        self.r: B = None
        self.z: C = None
        self.x: I = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.q: A = None
        self.p: B = None
        self.w: A = None
        self.txt = txt

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

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

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

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