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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.s: C = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

m.r = e
m.y = e
m.v = n
m.z = n
m.u = i
m.w = f
d.y = n
d.v = i
d.u = i
j.z = i
j.q = i
i.q = k
f.u = e
e.y = d
e.p = d
e.o = m
e.z = m
e.u = i
e.x = i
e.t = a
n.y = i
n.x = e
n.p = k
n.o = j
n.q = d
n.z = d
n.r = f
n.w = a
a.r = m
a.w = k
k.p = e
k.v = d
k.y = d
k.s = j
k.u = n
assert f.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.v: G = None
        self.z: G = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: B = None
        self.s: C = None
        self.y: B = None
        self.u: G = None
        self.txt = txt

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

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