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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: H = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: H = None
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

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

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

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