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

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

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

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

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

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

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

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

g = A("g")
h = B("h")
j = C("j")
i = D("i")
m = E("m")
l = F("l")
k = G("k")
f = H("f")
e = G("e")

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

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

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

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

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

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

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

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

g = A("g")
h = B("h")
j = C("j")
i = D("i")
m = E("m")
l = F("l")
k = G("k")
f = H("f")
e = G("e")

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