class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: C = None
        self.w: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.v: A = None
        self.y: A = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.v: A = None
        self.y: A = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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