class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.t: H = None
        self.o: G = None
        self.w: B = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: C = None
        self.q: E = None
        self.o: D = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: G = None
        self.w: G = None
        self.u: F = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

k = A("k")
l = B("l")
e = C("e")
a = D("a")
b = E("b")
m = F("m")
g = G("g")
f = H("f")

k.u = b
k.v = f
k.t = f
k.y = f
k.o = g
k.w = l
l.s = m
l.u = m
l.v = e
l.q = b
l.o = a
l.p = k
e.v = a
e.q = m
e.t = k
a.u = e
b.u = g
b.q = k
m.x = k
g.y = a
g.z = f
f.q = b
f.t = g
f.w = g
f.u = m
f.y = k
f.p = k
assert a.u.q.x.u.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.t: H = None
        self.o: G = None
        self.w: B = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: C = None
        self.q: E = None
        self.o: D = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: G = None
        self.w: G = None
        self.u: F = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

k = A("k")
l = B("l")
e = C("e")
a = D("a")
b = E("b")
m = F("m")
g = G("g")
f = H("f")

k.u = b
k.v = f
k.t = f
k.y = f
k.o = g
k.w = l
l.s = m
l.u = m
l.v = e
l.q = b
l.o = a
l.p = k
e.v = a
e.q = m
e.t = k
a.u = e
b.u = g
b.q = k
m.x = k
g.y = a
g.z = f
f.q = b
f.t = g
f.w = g
f.u = m
f.y = k
f.p = k
assert a.u.q.x.u.q.o.txt == "g"