class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: G = None
        self.o: G = None
        self.w: F = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.z: B = None
        self.w: F = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: G = None
        self.o: G = None
        self.w: F = None
        self.z: E = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: B = None
        self.z: B = None
        self.w: F = None
        self.p: E = None
        self.t: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: D = None
        self.x: C = None
        self.p: D = None
        self.txt = txt

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

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