class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: D = None
        self.x: H = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.q: A = None
        self.p: C = None
        self.r: H = None
        self.t: C = None
        self.z: H = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.s: G = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.q: A = None
        self.p: C = None
        self.r: H = None
        self.t: C = None
        self.z: H = None
        self.x: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.s: G = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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