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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.x: D = None
        self.q: A = None
        self.t: E = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: F = None
        self.z: G = None
        self.r: F = None
        self.p: G = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.x: D = None
        self.q: A = None
        self.t: E = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: F = None
        self.z: G = None
        self.r: F = None
        self.p: G = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: D = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

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

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