class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: H = None
        self.r: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: I = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

f.z = b
f.w = k
f.r = k
b.o = a
b.s = m
b.r = m
b.w = g
b.y = d
b.u = c
b.q = c
b.z = f
d.r = f
g.t = d
g.x = i
g.w = i
i.x = d
i.y = m
i.o = k
a.x = k
a.s = m
c.o = a
c.w = m
c.s = i
c.u = d
k.z = c
m.u = c
m.t = g
assert c.u.r.z.z.z.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: H = None
        self.r: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: I = None
        self.s: E = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: D = None
        self.txt = txt

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

f.z = b
f.w = k
f.r = k
b.o = a
b.s = m
b.r = m
b.w = g
b.y = d
b.u = c
b.q = c
b.z = f
d.r = f
g.t = d
g.x = i
g.w = i
i.x = d
i.y = m
i.o = k
a.x = k
a.s = m
c.o = a
c.w = m
c.s = i
c.u = d
k.z = c
m.u = c
m.t = g
assert c.u.r.z.z.z.u.u.txt == "d"