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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
l = C("l")
f = D("f")
i = E("i")
h = F("h")
j = B("j")
c = D("c")

e.r = g
e.s = h
e.w = c
e.x = l
g.o = e
l.o = g
l.z = c
f.q = g
f.x = j
f.o = e
i.w = l
i.r = e
i.p = e
i.y = g
i.q = f
h.z = i
h.r = l
j.o = e
c.q = g
c.x = j
c.o = e
assert f.q.o.x.z.x.o.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: F = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
l = C("l")
f = D("f")
i = E("i")
h = F("h")
j = B("j")
c = D("c")

e.r = g
e.s = h
e.w = c
e.x = l
g.o = e
l.o = g
l.z = c
f.q = g
f.x = j
f.o = e
i.w = l
i.r = e
i.p = e
i.y = g
i.q = f
h.z = i
h.r = l
j.o = e
c.q = g
c.x = j
c.o = e
assert f.q.o.x.z.x.o.s.z.txt == "i"