class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: D = None
        self.o: C = None
        self.t: F = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.q: C = None
        self.z: C = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

g = A("g")
e = B("e")
l = C("l")
i = D("i")
h = E("h")
m = F("m")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.q: C = None
        self.z: C = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

g = A("g")
e = B("e")
l = C("l")
i = D("i")
h = E("h")
m = F("m")

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