class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: B = None
        self.txt = txt

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

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