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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: G = None
        self.q: F = None
        self.x: C = None
        self.u: G = None
        self.p: C = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: B = None
        self.y: D = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
l = C("l")
m = D("m")
a = E("a")
j = F("j")
g = G("g")

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: G = None
        self.q: F = None
        self.x: C = None
        self.u: G = None
        self.p: C = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: B = None
        self.y: D = None
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

d = A("d")
i = B("i")
l = C("l")
m = D("m")
a = E("a")
j = F("j")
g = G("g")

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