class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

n = A("n")
i = B("i")
b = C("b")
m = D("m")
l = E("l")
a = F("a")
h = G("h")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

n = A("n")
i = B("i")
b = C("b")
m = D("m")
l = E("l")
a = F("a")
h = G("h")
d = F("d")

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