class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.t: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.x: F = None
        self.v: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: B = None
        self.x: F = None
        self.v: F = None
        self.w: E = None
        self.txt = txt

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

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

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