class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: B = None
        self.v: H = None
        self.w: E = None
        self.o: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: H = None
        self.u: G = None
        self.r: C = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: I = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.z: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: E = None
        self.t: A = None
        self.q: E = None
        self.y: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: H = None
        self.u: G = None
        self.r: C = None
        self.q: H = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: I = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.z: B = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: E = None
        self.t: A = None
        self.q: E = None
        self.y: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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