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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: E = None
        self.y: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: E = None
        self.y: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.t: B = None
        self.txt = txt

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

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

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

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